<div class="modal " *ngIf="showModal" tabindex="-1" role="dialog" name="create_task" aria-labelledby="gridSystemModalLabel">
        <form class="modal-dialog editDeviceForm width_700"  [formGroup]="validateForm" autocomplete="off"  (ngSubmit)="submitForm()">
                <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="close()"><span aria-hidden="true"></span></button>
                        <h4 class="modal-title"><span *ngIf="!example.id">新增</span><span *ngIf="example.id">编辑</span></h4>
                    </div>
                    <div class="modal-body">
                        <div class="row margin_b_10">
                            <div class="col-sm-2 pading_r_0">名称</div>
                            <div class="col-sm-10">
                               <input type="text"  class="form-control" formControlName = "name" [(ngModel)]="example.name">
                               <p class="text-danger font_12" *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">名称字数限制2-20</p>
                            </div>
                        </div>
                        <div class="row margin_b_10">
                            <div class="col-sm-2 pading_r_0">激活</div>
                            <div class="col-sm-10">
                                <input formControlName = "enabled" *ngIf="example.enabled" checked  type="checkbox" value="1">
                                <input formControlName = "enabled" *ngIf="!example.enabled" type="checkbox" value="0">
                                是
                            </div>
                        </div>

                        <div class="row margin_b_10">
                            <div class="col-sm-2 pading_r_0">计划</div>
                            <div class="col-sm-10">
                                <select class="form-control" formControlName = "schedule" [(ngModel)]="example.schedule.weekday">
                                    <option class="form-control" value="-1">请选择</option>
                                    <option class="form-control"  *ngFor="let v of weekdays;let i = index" [value]="i">{{v}}</option>
                                </select>
                                <p class="text-danger font_12" *ngIf="validateForm.get('schedule').dirty && validateForm.get('schedule').errors">请选择计划</p>
                            </div>
                        </div>
                        <div class="row margin_b_10">
                                <div class="col-sm-2 pading_r_0">描述</div>
                                <div class="col-sm-10">
                                    <textarea formControlName="description" [(ngModel)]="example.description"  class="form-control"></textarea>
                                    <p class="text-danger font_12" *ngIf="validateForm.get('description').dirty && validateForm.get('description').errors">10-200个数字之间</p>
                                </div>
                            </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="model_btn" data-dismiss="modal" (click)="close()">返回</button>
                        <button type="submit" class="model_btn">保存</button>
                    </div>
                </div>
            </div>
            </form>
</div>

